package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MemberLevelDiscountMapper;
import com.ruoyi.system.domain.MemberLevelDiscount;
import com.ruoyi.system.service.IMemberLevelDiscountService;

/**
 * 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class MemberLevelDiscountServiceImpl implements IMemberLevelDiscountService
{
    @Autowired
    private MemberLevelDiscountMapper memberLevelDiscountMapper;

    /**
     * 通过id查询会员等级折扣管理
     *
     * @param id 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）主键
     * @return 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）
     */
    @Override
    public MemberLevelDiscount selectMemberLevelDiscountById(Long id)
    {
        return memberLevelDiscountMapper.selectMemberLevelDiscountById(id);
    }

    /**
     * 查询会员等级折扣管理列表
     *
     * @param memberLevelDiscount 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）
     * @return 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）
     */
    @Override
    public List<MemberLevelDiscount> selectMemberLevelDiscountList(MemberLevelDiscount memberLevelDiscount)
    {
        return memberLevelDiscountMapper.selectMemberLevelDiscountList(memberLevelDiscount);
    }

    /**
     * 新增会员等级折扣管理列表
     *
     * @param memberLevelDiscount 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）
     * @return 结果
     */
    @Override
    public int insertMemberLevelDiscount(MemberLevelDiscount memberLevelDiscount)
    {
        return memberLevelDiscountMapper.insertMemberLevelDiscount(memberLevelDiscount);
    }

    /**
     * 修改会员等级折扣管理列表
     *
     * @param memberLevelDiscount 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）
     * @return 结果
     */
    @Override
    public int updateMemberLevelDiscount(MemberLevelDiscount memberLevelDiscount)
    {
        return memberLevelDiscountMapper.updateMemberLevelDiscount(memberLevelDiscount);
    }

    /**
     * 批量删除会员等级折扣管理列表
     *
     * @param ids 需要删除的会员等级折扣管理（存储会员等级、折扣规则及特殊规则）主键
     * @return 结果
     */
    @Override
    public int deleteMemberLevelDiscountByIds(Long[] ids)
    {
        return memberLevelDiscountMapper.deleteMemberLevelDiscountByIds(ids);
    }

    /**
     * 删除会员等级折扣管理列表
     *
     * @param id 会员等级折扣管理（存储会员等级、折扣规则及特殊规则）主键
     * @return 结果
     */
    @Override
    public int deleteMemberLevelDiscountById(Long id)
    {
        return memberLevelDiscountMapper.deleteMemberLevelDiscountById(id);
    }
}
